NumToA
#![no_std]
Compatible with Zero Heap Allocations
The standard library provides a convenient method of converting numbers into strings, but these strings are
heap-allocated. If you have an application which needs to convert large volumes of numbers into strings, but don't
want to pay the price of heap allocation, this crate provides an efficient no_std
-compatible method of heaplessly converting numbers
into their string representations, storing the representation within a reusable byte array.
Supports Multiple Bases
In addition to supporting the standard base 10 conversion, this implementation allows you to select the base of your choice. Therefore, if you want a binary representation, set the base to 2. If you want hexadecimal, set the base to 16.
&str
Example
use NumToA;
let mut buffer = ;
println!;
println!;
&[u8]
Example
use NumToA;
use ;
let stdout = stdout;
let mut stdout = stdout.lock;
let mut buffer = ;
let number: u32 = 162392;
let _ = stdout.write;
let _ = stdout.write;
assert_eq!;
let number: i32 = -6235;
let _ = stdout.write;
let _ = stdout.write;
let number: i8 = -128;
let _ = stdout.write;
let _ = stdout.write;
let number: i8 = 53;
let _ = stdout.write;
let _ = stdout.write;
let number: i16 = -256;
let _ = stdout.write;
let _ = stdout.write;
let number: i16 = -32768;
let _ = stdout.write;
let _ = stdout.write;
let number: u64 = 35320842;
let _ = stdout.write;
let _ = stdout.write;
let number: u64 = 18446744073709551615;
let _ = stdout.write;
let _ = stdout.write;